-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ERR: Fix GH13139: better error message on invalid pd.eval and df.query input #14473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Current coverage is 85.26% (diff: 100%)@@ master #14473 diff @@
==========================================
Files 140 140
Lines 50640 50641 +1
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 43175 43178 +3
+ Misses 7465 7463 -2
Partials 0 0
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
@@ -57,3 +57,4 @@ Bug Fixes | |||
|
|||
- Bug in ``pd.pivot_table`` may raise ``TypeError`` or ``ValueError`` when ``index`` or ``columns`` | |||
is not scalar and ``values`` is not specified (:issue:`14380`) | |||
- pd.eval('') and df.query('') now show better error message and raise ``ValueError`` (:issue: `13139`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more like
correctly raise ValueError on empty input to pd.eval()
and df.query()
. This
@@ -1891,6 +1891,17 @@ def test_bad_resolver_raises(): | |||
yield check_bad_resolver_raises, engine, parser | |||
|
|||
|
|||
def check_empty_string_raises(engine, parser): | |||
tm.skip_if_no_ne(engine) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add the issue refernce in a comment
just a doc-comment. pls push ; ping when green. |
thanks! |
… invalid pd.eval and df.query input closes pandas-dev#13139 Added test case to check for invalid input(empy string) on pd.eval('') and df.query(''). Used existing helper function(_check_expression) Author: Thiago Serafim <[email protected]> Closes pandas-dev#14473 from tserafim/issue#13139 and squashes the following commits: 77483dd [Thiago Serafim] ERR: correctly raise ValueError on empty input to pd.eval() and df.query() (pandas-dev#13139) 9a5c55f [Thiago Serafim] Fix GH13139: better error message on invalid pd.eval and df.query input (cherry picked from commit 1308884)
git diff upstream/master | flake8 --diff
Added test case to check for invalid input(empy string) on pd.eval('') and df.query('').
Used existing helper function(_check_expression)